<?php 
class Md_User extends WdkModel
{
	public function __construct()
	{
		parent::__construct();
		$this->_init();
	}
	
	private function _init()
	{
		$this->table	= 'user';
		$this->order	= array("`user_seq` DESC");
	}
	
	/**
	 *	Select query for Classes..
	 *  @author	kinuz
	 *  @since	2011. 3. 25
	 */
	public function cLoad($user_seq)
	{
		$sql = "SELECT
					`u`.*
				FROM
					`{$this->table}` AS `u`
				WHERE `user_seq` = {$this->escape($user_seq)}
				LIMIT 0, 1
			";
		$this->dbo->execute($sql);
		if($this->dbo->numRows() > 0)
		{
			return $this->dbo->row();    		
		}
		throw new NoRecordException("레코드가 존재하지 않습니다.. : ( user_seq : {$user_seq} )");
	}
	
	/**
	 *	Select query for Classes..
	 *  @author	kinuz
	 *  @since	2011. 3. 25
	 */
	public function cLoadByLoginId($user_login_id)
	{
		$sql = "SELECT
					`u`.*
				FROM
					`{$this->table}` AS `u`
				WHERE `user_login_id` = '{$this->escape($user_login_id)}'
				LIMIT 0, 1
			";
		$this->dbo->execute($sql);
		if($this->dbo->numRows() > 0)
		{
			return $this->dbo->row();    		
		}
		throw new NoRecordException("레코드가 존재하지 않습니다.. : ( user_seq : {$user_seq} )");
	}
}